package com.xxx.host;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.Window.Type;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.UIManager;
import java.awt.SystemColor;

public class main extends JFrame {

	private JPanel contentPane;
	ButtonGroup bg;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					main frame = new main();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public main() {
		setType(Type.UTILITY);
		setBackground(UIManager.getColor("ProgressBar.selectionForeground"));
		this.setTitle("主机安全防护");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 734, 501);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JLabel label = new JLabel("恶意代码防护：");
		label.setFont(new Font("宋体", Font.PLAIN, 22));
		label.setBackground(UIManager.getColor("Button.light"));
		label.setBounds(15, 78, 155, 21);
		contentPane.add(label);
		
		final JRadioButton rdbtnNewRadioButton = new JRadioButton("获取木马文件信息");
		rdbtnNewRadioButton.setSelected(true);
		rdbtnNewRadioButton.setFont(new Font("宋体", Font.PLAIN, 19));
		rdbtnNewRadioButton.setBackground(UIManager.getColor("ProgressBar.selectionForeground"));
		rdbtnNewRadioButton.setBounds(181, 11, 185, 29);
		contentPane.add(rdbtnNewRadioButton);
		
		final JRadioButton rdbtnNewRadioButton_1 = new JRadioButton("隔离木马");
		rdbtnNewRadioButton_1.setFont(new Font("宋体", Font.PLAIN, 19));
		rdbtnNewRadioButton_1.setBounds(422, 11, 177, 29);
		contentPane.add(rdbtnNewRadioButton_1);
		
		final JRadioButton rdbtnNewRadioButton_2 = new JRadioButton("信任木马文件");
		rdbtnNewRadioButton_2.setFont(new Font("宋体", Font.PLAIN, 19));
		rdbtnNewRadioButton_2.setBounds(181, 58, 177, 29);
		contentPane.add(rdbtnNewRadioButton_2);
		
		final JRadioButton rdbtnNewRadioButton_3 = new JRadioButton("恢复木马文件");
		rdbtnNewRadioButton_3.setFont(new Font("宋体", Font.PLAIN, 19));
		rdbtnNewRadioButton_3.setBounds(422, 58, 177, 29);
		contentPane.add(rdbtnNewRadioButton_3);
		
		final JRadioButton radioButton = new JRadioButton("删除木马记录");
		radioButton.setFont(new Font("宋体", Font.PLAIN, 19));
		radioButton.setBounds(181, 107, 177, 29);
		contentPane.add(radioButton);
		
		JLabel label_1 = new JLabel("高危漏洞探测：");
		label_1.setFont(new Font("宋体", Font.PLAIN, 22));
		label_1.setBackground(UIManager.getColor("Button.light"));
		label_1.setBounds(15, 201, 155, 21);
		contentPane.add(label_1);
		
		final JRadioButton radioButton_1 = new JRadioButton("获取漏洞检测结果");
		radioButton_1.setFont(new Font("宋体", Font.PLAIN, 19));
		radioButton_1.setBounds(181, 163, 185, 29);
		contentPane.add(radioButton_1);
		
		final JRadioButton radioButton_2 = new JRadioButton("获取漏洞列表");
		radioButton_2.setFont(new Font("宋体", Font.PLAIN, 19));
		radioButton_2.setBounds(422, 163, 177, 29);
		contentPane.add(radioButton_2);
		
		final JRadioButton radioButton_3 = new JRadioButton("获取漏洞详情");
		radioButton_3.setFont(new Font("宋体", Font.PLAIN, 19));
		radioButton_3.setBounds(181, 218, 177, 29);
		contentPane.add(radioButton_3);
		
		final JRadioButton radioButton_4 = new JRadioButton("获取漏洞受影响机器列表");
		radioButton_4.setFont(new Font("宋体", Font.PLAIN, 19));
		radioButton_4.setBounds(422, 218, 241, 29);
		contentPane.add(radioButton_4);
		
		final JRadioButton radioButton_5 = new JRadioButton("获取单台主机漏洞列表");
		radioButton_5.setFont(new Font("宋体", Font.PLAIN, 19));
		radioButton_5.setBounds(181, 265, 223, 29);
		contentPane.add(radioButton_5);
		
		final JRadioButton radioButton_6 = new JRadioButton("忽略漏洞");
		radioButton_6.setFont(new Font("宋体", Font.PLAIN, 19));
		radioButton_6.setBounds(422, 265, 177, 29);
		contentPane.add(radioButton_6);
		
		JLabel label_2 = new JLabel("日志审计防护：");
		label_2.setFont(new Font("宋体", Font.PLAIN, 22));
		label_2.setBackground(UIManager.getColor("Button.light"));
		label_2.setBounds(15, 340, 155, 21);
		contentPane.add(label_2);
		
		final JRadioButton radioButton_7 = new JRadioButton("获取破解事件列表");
		radioButton_7.setFont(new Font("宋体", Font.PLAIN, 19));
		radioButton_7.setBounds(181, 319, 197, 29);
		contentPane.add(radioButton_7);
		
		final JRadioButton radioButton_8 = new JRadioButton("获取异地登录事件");
		radioButton_8.setFont(new Font("宋体", Font.PLAIN, 19));
		radioButton_8.setBounds(422, 319, 197, 29);
		contentPane.add(radioButton_8);
		
		final JRadioButton radioButton_9 = new JRadioButton("误报异地登录");
		radioButton_9.setFont(new Font("宋体", Font.PLAIN, 19));
		radioButton_9.setBounds(181, 370, 177, 29);
		contentPane.add(radioButton_9);
		
		final JButton btnNewButton = new JButton("确定");
		btnNewButton.setBackground(UIManager.getColor("Button.light"));
		btnNewButton.setBounds(530, 401, 123, 29);
		contentPane.add(btnNewButton);
        contentPane.add(btnNewButton, BorderLayout.SOUTH);
		
		final JRadioButton rdbtnNewRadioButton_4 = new JRadioButton("概览情况");
		rdbtnNewRadioButton_4.setFont(new Font("宋体", Font.PLAIN, 19));
		rdbtnNewRadioButton_4.setBounds(6, 0, 164, 29);
		contentPane.add(rdbtnNewRadioButton_4);
		JRadioButton rdbtnNewRadioButton_5 = new JRadioButton("主机列表\r\n");
		rdbtnNewRadioButton_5.setFont(new Font("宋体", Font.PLAIN, 19));
		rdbtnNewRadioButton_5.setBounds(6, 36, 148, 29);
		contentPane.add(rdbtnNewRadioButton_5);
		ButtonGroup group=new ButtonGroup();
		group.add(rdbtnNewRadioButton);
		group.add(rdbtnNewRadioButton_1);
		group.add(rdbtnNewRadioButton_2);
		group.add(rdbtnNewRadioButton_3);
		group.add(radioButton);
		group.add(radioButton_1);
		group.add(radioButton_2);
		group.add(radioButton_3);
		group.add(radioButton_4);
		group.add(radioButton_5);
		group.add(radioButton_6);
		group.add(radioButton_7);
		group.add(radioButton_8);
		group.add(radioButton_9);
		group.add(rdbtnNewRadioButton_4);
		group.add(rdbtnNewRadioButton_5);
		
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				String function=null;
				if(rdbtnNewRadioButton .isSelected()){
				function="func1";
				}
				else{
					if(rdbtnNewRadioButton_1 .isSelected())
				function="func2";
					else if(rdbtnNewRadioButton_2 .isSelected())
						function="func3";
					else if(rdbtnNewRadioButton_3 .isSelected())
						function="func4";
					else if(radioButton .isSelected())
						function="func5";
					else if(radioButton_1 .isSelected())
						function="func6";
					else if(radioButton_2 .isSelected())
						function="func7";
					else if(radioButton_3 .isSelected())
						function="func8";
					else if(radioButton_4 .isSelected())
						function="func9";
					else if(radioButton_5 .isSelected())
						function="func10";
					else if(radioButton_6 .isSelected())
						function="func11";
					else if(radioButton_7 .isSelected())
						function="func12";
					else if(radioButton_8 .isSelected())
						function="func13";
					else if(radioButton_9 .isSelected())
						function="func14";
					else if (rdbtnNewRadioButton_4 .isSelected()) 
						function="func15";
					else function="func16";
				}
				if(e.getSource()==btnNewButton) {
					dispose();
				
				if (function=="func1") 
					new describemalwarestest();
					
				else if(function=="func2") 
					new SeparateMalwarestest();
				else if(function=="func3")
					new TrustMalwarestest();
				else if(function=="func4")
					new RecoverMalwarestest();
				else if(function=="func5")
					new DeleteMalwarestest();
				else if(function=="func6")
					new DescribeVulScanResulttest();
				else if(function=="func7")
					new DescribeVulstest();
				else if(function=="func8")
					new DescribeVulInfotest();
				else if(function=="func9")
					new DescribeImpactedHoststest();
				else if(function=="func10")
					new DescribeAgentVulstest();
				else if(function=="func11")
					new IgnoreImpactedHoststest();
				else if(function=="func12")
					new DescribeBruteAttackstest();
				else if(function=="func13")
				   new DescribeNonlocalLoginPlacestest();
				else if(function=="func14")
					new MisAlarmNonlocalLoginPlacestest();
				else if(function=="func15")
					new DescribeOverviewStatisticstest();
				else new DescribeMachinestest();
				
				
				}
				
				}
			}
		);
		
		
		
	}
	}

